home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / systems / atari / birkhahn-metafont-packed-disks / mf27-2_2e-disk2.zoo / inputs / pandora.lzs / WIDTHS.MF < prev   
Text File  |  1991-08-15  |  6KB  |  137 lines

  1. %*****************************************************************************
  2. %        Copyright (c) 1989 by N. N. Billawala
  3. %*****************************************************************************
  4.  
  5.  
  6. % widths.mf a file containing width calculation information for the chars
  7.  
  8. % Essentially all width information is contained in this file to eliminate
  9. % the need to alter the individual character files if width changes are desired.
  10.  
  11. % Parts of characters are separated so that amounts can be altered as shapes 
  12. % change for the lowercase, the stems are all generally of the same weight,
  13. %  with possible variation in diagonals.
  14. % The uppercase has more variation in combination of thin/thick vertical
  15. %  stems, so the method for choosing widths was changed to depend on
  16. %  stem weights and an idea of proportions
  17. % Fixed width characters and numbers have a constant total width,
  18. %  but reference and fitting proportions vary within this space
  19. % Punctuation was partly based on uc/lc widths, but otherwise 
  20. %  independent amounts given.
  21.  
  22. vardef variable_character_reference_widths=
  23.  save thick,thin,thickk,thinn,bowll;
  24.  
  25.   thick=stem.uc#/max(width#,1);         uc:=.35*boldness; 
  26.      uc1=.35*boldness;  uc4=.35; % always=.35;
  27.      uc2:=1+if boldness<1:.25 else:0 fi; % uc2 for diagonals
  28.   thin=thin_stem.uc#/max(width#,1);     lc.arch_space:=.21*boldness;
  29.   thickk=stem.lc#/max(width#,1);        lc.bowl_space:=.24*boldness; 
  30.   thinn=thin_stem.lc#/max(width#,1);    lc.o_space:=.27*boldness;
  31.   bowll=bowlstem.lc#/max(width#,1);     lc.diagonal_space:=.3*boldness;
  32.  
  33.   i_w=thickk;                               % i l    the "_w" is for "width"
  34.   j_w=thickk+.55*lc.arch_space;             % j
  35.   s_w=uc2*(thickk+lc.o_space);              % s t z ***
  36.   c_w=uc2*(bowll+lc.o_space);               % c ***
  37.   a_w=thickk+bowll+lc.arch_space;           % a(halfbowl)
  38.   b_w=thickk+bowll+lc.bowl_space;           % b a d e g p q k ss-lig
  39.   r_w=2thickk+.5*lc.arch_space;             % r f
  40.   n_w=2thickk+lc.arch_space;                % n h u
  41.   m_w=3thickk+2*lc.arch_space;              % m
  42.   o_w=2bowll+lc.bowl_space;                 % g(halfbowl)
  43.   oo_w=2bowll+lc.o_space;                   % o 
  44.   v_w=(uc2)*(thickk+thinn)+lc.diagonal_space; % v x y ***
  45.   w_w=(uc2)*(thickk+thinn)+thickk+1.5lc.diagonal_space; % w ***
  46.   oe_w=oo_w+o_w-bowll;                      % oe
  47.   ae_w=2b_w-bowll;                          % ae
  48.   accent_w=.8n_w;                           % accents
  49.  
  50.   I_w=thick;                % I
  51.   J_w=thick+.5uc;           % J
  52.   E_w=thick+.85uc4;         % E F L GAMMA  ****
  53.   T_w=thick+1.25uc1;        % T     ****
  54.   B_w=2thick+.75uc;         % B P 
  55.   R_w=2thick+.85uc1;        % R PI XI K ****SIGMA
  56.   H_w=2thick+uc;            % H C 
  57.   D_w=2thick+1.1uc;         % D G 
  58.   O_w=2thick+1.25uc;        % O Q DELTA THETA
  59.   N_w=H_w;                  % N
  60.   S_w=thick+thin+.75uc;     % S Z  ****
  61.   U_w=thick+thin+uc;        % U   ****
  62.   A_w=(uc2)*(thick+thin)+1.25uc1; % A V Y LAMBDA X ****
  63.   M_w=(uc2)*2(thick+thin)+1.25uc; % M
  64.   W_w=(uc2)*(2thick+thin)+1.5uc1; % W    ****
  65.   AE_w=E_w+2/3*A_w;         % AEligature
  66.   OE_w=E_w+O_w-thick;       % OEligature
  67.                                          
  68.   v_a=.50;                  % for straight strokes  the "v_" is for "variable"
  69.   v_b=.42;                  % for arches
  70.   v_c=.28;                  % for bowls
  71.   v_d=.24;                  % for thick diagonals 
  72.   v_e=v_d-(thickk-thinn);   % for thin diagonals 
  73.   v_f=.20;                  % for half open shapes
  74.   v_g=.10;                  % for open strokes
  75.   v_h=.08;                  % for open strokes
  76.  
  77.   v_A=.5;                   % for thick straight
  78.   v_B=v_A-(thick-thin);     % for thin straight 
  79.   v_C=.2;                   % for bowls
  80.   v_D=.16;                  % for thick diagonals
  81.   v_E=v_D-(thick-thin);     % for thin diagonals
  82.   v_F=.2;                   % for half open sides 
  83.   v_G=.16;                  % for half-very open sides 
  84.   v_H=.12;                  % for very open sides
  85.   v_I=.1;                   % for the L
  86.  
  87. enddef;
  88.  
  89. variable_character_reference_widths;  
  90.  
  91. %***** for numbers *****
  92.  
  93. num_width_a#=.2width#;  num_fit_a#+num_width_a#=.55width#;    % 1
  94. num_width_b#=.4width#;  num_fit_b#+num_width_b#=.55width#;    % 2 3 5 7 $
  95. num_width_c#=.44width#; num_fit_c#+num_width_c#=.55width#;    % 6 9 0
  96. num_width_d#=.47width#; num_fit_d#+num_width_d#=.55width#;    % 8  
  97. num_width_e#=.50width#; num_fit_e#+num_width_e#=.55width#;    % 4
  98.  
  99. %***** for single pitch fonts *****
  100.  
  101. % *_*mono# gives the character reference width within the total per char width
  102. % *_mfit#  is the amount of space left after the reference width is taken away
  103. % *_*mono#+*_mfit# give the total width of the character
  104. % In the case of single pitch fonts, the total width is always the same.
  105. % In cases where, e.g., three instead of only one width is desired, the
  106. %   value of 1*mono# can be changed
  107.  
  108.  a_mono#:=.6mono#;  a_mfit#+a_mono#=mono#;     % fjrJ',.:;
  109.  b_mono#:=.7mono#;  b_mfit#+b_mono#=mono#;     % "mid" width
  110.  c_mono#:=.75mono#; c_mfit#+c_mono#=mono#;     % abdgkpq069
  111.  d_mono#:=.8mono#;  d_mfit#+d_mono#=mono#;     % eotvxyz4689CDGKOQ%&*^
  112.  e_mono#:=.9mono#;  e_mfit#+e_mono#=mono#;     % AVXY4
  113.  f_mono#:=.9mono#;  f_mfit#+f_mono#=mono#;     % mwMW@ ae oe AE OE
  114.  
  115. define_pixels(a_mono,b_mono,c_mono,d_mono,e_mono,f_mono,
  116.               a_mfit,b_mfit,c_mfit,d_mfit,e_mfit,f_mfit); 
  117.                            
  118. % The following give fit adjustments for single pitch characters
  119.  
  120.  m_a=.5;                   % this amt is always .5
  121.  m_b=.55; m_bb+m_b=1;      % BDEFGKPR7
  122.  m_c=.55; m_cc+m_c=1;      % abdghkmnpqu()
  123.  m_d=.6;  m_dd+m_d=1;      % C
  124.  m_e=.65; m_ee+m_e=1;      % cflrt AE []
  125.  m_f=.75; m_ff+m_f=1;      % JL
  126.  
  127. %**********
  128.  
  129. % need to account for serifs
  130. % recognizing that a straight ascender may carry different visual value as
  131. % straight of x-height
  132.  
  133. %**********
  134.  
  135.  
  136.  
  137.